home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / compat / dirent2.h < prev    next >
C/C++ Source or Header  |  1992-11-06  |  2KB  |  63 lines

  1. /*
  2.  * dirent.h --
  3.  *
  4.  *    Declarations of a library of directory-reading procedures
  5.  *    in the POSIX style ("struct dirent").
  6.  *
  7.  * Copyright 1991 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that this copyright
  11.  * notice appears in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/src/lib/tcl/compat/RCS/dirent2.h,v 1.1 91/09/19 16:22:08 ouster Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _DIRENT
  20. #define _DIRENT
  21.  
  22. #ifndef _TCL
  23. #include <tcl.h>
  24. #endif
  25.  
  26. /*
  27.  * Dirent structure, which holds information about a single
  28.  * directory entry.
  29.  */
  30.  
  31. #define MAXNAMLEN 255
  32. #define DIRBLKSIZ 512
  33.  
  34. struct dirent {
  35.     long d_ino;            /* Inode number of entry */
  36.     short d_reclen;        /* Length of this record */
  37.     short d_namlen;        /* Length of string in d_name */
  38.     char d_name[MAXNAMLEN + 1];    /* Name must be no longer than this */
  39. };
  40.  
  41. /*
  42.  * State that keeps track of the reading of a directory (clients
  43.  * should never look inside this structure;  the fields should
  44.  * only be accessed by the library procedures).
  45.  */
  46.  
  47. typedef struct _dirdesc {
  48.     int dd_fd;
  49.     long dd_loc;
  50.     long dd_size;
  51.     char dd_buf[DIRBLKSIZ];
  52. } DIR;
  53.  
  54. /*
  55.  * Procedures defined for reading directories:
  56.  */
  57.  
  58. extern void        closedir _ANSI_ARGS_((DIR *dirp));
  59. extern DIR *        opendir _ANSI_ARGS_((char *name));
  60. extern struct dirent *    readdir _ANSI_ARGS_((DIR *dirp));
  61.  
  62. #endif /* _DIRENT */
  63.